home *** CD-ROM | disk | FTP | other *** search
/ SPACE 1 / SPACE - Library 1 - Volume 1.iso / demos / 139 / multwait.ap < prev    next >
Encoding:
Text File  |  1988-03-02  |  1.5 KB  |  37 lines

  1. |
  2. | Sample AutoPilot script: Waiting for multiple phrases from the modem
  3. |____________________________________________________________________________
  4. clear
  5. trace off
  6. |____________________________________________________________________________
  7. st=""                   | make a string variable
  8. array st 5              | dimension it to hold 5 strings
  9.                         |
  10. st[1]="this"            | fill them with the phrases to wait for
  11. st[2]="that"            |
  12. st[3]="anything"        |
  13. st[4]="mail waiting"    |
  14. st[5]="goodbye"         |
  15.                         |
  16. goodbye=5               | just for the heck of it
  17.                         |
  18. _begin                  | place to loop back to
  19.                         |
  20. choice = Wait 30 st     | wait for 1 of the phrases for 30 seconds
  21.                         |
  22. Print "choice="         | put the results to the screen, 0 if timed-out
  23. Print choice            | choice matches the string array index if found
  24. Print "~"               | a carriage return
  25.                         |
  26. IF choice               | print the phrase to the screen if found
  27.     Print st[choice]    | note: see how arrays can be used anywhere
  28.     Print "~"           |
  29. ENDIF                   |
  30.                         |
  31. IF the choice is goodbye| checking for choice 5 (add other ELSEIF's as needed)
  32.     QUIT                |
  33. ENDIF                   |
  34.                         |
  35. GOTO begin              | keep on going
  36.                         | remember, the <UNDO> key may be used to end autopilot